import Vue from 'vue'
import Router from 'vue-router'

import page from       'components/page/main.vue';
import mylist from     'components/page/list'
import mysave from     'components/common/save'
import menu_group from 'components/edit/menu_group'
import mysort from 'components/sort/index'
import p404 from        'components/page/404'
import home from        'components/page/home'
import tool_dev from        'components/page/tool_dev'

//权限
// import control_group from 'components/page/permission/control_group'
//区域排序
import region_sort from 'components/page/region_sort'

Vue.use(Router)

const routes = [
  {
    path: '/',
    redirect: '/page/home',
    component: page,
    // redirect: '/page/list',
  },
  {

    path: '/page',
    component: page,
    redirect: '/page/list',
    children: [
      {
        path: 'login',
        component: page,
      },
      {
        path: 'tool_dev',
        component: tool_dev,
      },

      {
        path: 'add',
        component: mysave,
      },
      {
        path: 'edit',
        component: mysave,
      },
      {
        path: 'copy',
        component: mysave,
      },
      {
        path: 'detail',
        component: mysave,
      },
      {
        path: 'list',
        component: mylist,
      },
      {
        path: 'menu_group',
        component: menu_group,
      },
      {
        path: 'sort',
        component: mysort,
      },
      // {
      //   path: 'control_group/add',
      //   component: control_group
      // },
      // {
      //   path: 'control_group/edit',
      //   component: control_group
      // },
      {
        path: 'home',
        component: home
      },
      {
        path: 'region_sort',
        component: region_sort
      },

    ]
  },
  {
    path: '*',
    redirect: '/404',
    component: p404
  },
  {
    path: '/404',
    component: p404
  }


]


export default new Router(
  {
    mode: 'history',
    routes: routes
  })
